home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Periodicals / develop / develop 4 code / A⁄ROSE / MCPMBƒ / MBTaskSample.r < prev    next >
Encoding:
Text File  |  1990-08-27  |  4.8 KB  |  248 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2. #
  3. #    MBTaskSample.r
  4. #
  5. #    derived from MPW 3.1's "Sample", a MultiFinder-Aware Simple Sample Application
  6. #   - and nearly the same thing as the "TaskSample" in the neighbour folder.
  7. #
  8. #   Launch "MBTaskSample" first, and then "Exercise", and do A/ROSE parallel processing
  9. #   (or rather: Program-to-program communication) even without MCP card!
  10. #
  11. #    Components:
  12. #                MBTaskSample.c
  13. #                MBTaskSample.r
  14. #                MBTaskSample.h
  15. #                MBTaskSample.make
  16. #
  17. ------------------------------------------------------------------------------*/
  18.  
  19.  
  20. #include "Types.r"
  21.  
  22. #include "MBTaskSample.h"
  23.  
  24.  
  25.  
  26. resource 'MBAR' (rMenuBar, preload) {
  27.     { mApple, mFile, mEdit, mSleep};
  28. };
  29.  
  30.  
  31. resource 'MENU' (mApple, preload) {
  32.     mApple, textMenuProc,
  33.     AllItems & ~MenuItem2,    /* Disable dashed line, enable About and DAs */
  34.     enabled, apple,
  35.     {
  36.         "About MBTaskSample…",
  37.             noicon, nokey, nomark, plain;
  38.         "-",
  39.             noicon, nokey, nomark, plain
  40.     }
  41. };
  42.  
  43. resource 'MENU' (mFile, preload) {
  44.     mFile, textMenuProc,
  45.     AllItems,
  46.     enabled, "File",
  47.     {
  48.         "Reset",
  49.             noicon, "R", nomark, plain;
  50.         "-",
  51.             noicon, nokey, nomark, plain;
  52.         "Quit",
  53.             noicon, "Q", nomark, plain
  54.     }
  55. };
  56.  
  57. resource 'MENU' (mEdit, preload) {
  58.     mEdit, textMenuProc,
  59.     NoItems,                /* disable everything, program does the enabling */
  60.     enabled, "Edit",
  61.      {
  62.         "Undo",
  63.             noicon, "Z", nomark, plain;
  64.         "-",
  65.             noicon, nokey, nomark, plain;
  66.         "Cut",
  67.             noicon, "X", nomark, plain;
  68.         "Copy",
  69.             noicon, "C", nomark, plain;
  70.         "Paste",
  71.             noicon, "V", nomark, plain;
  72.         "Clear",
  73.             noicon, nokey, nomark, plain
  74.     }
  75. };
  76.  
  77. resource 'MENU' (mSleep, preload) {
  78.     mSleep, textMenuProc,
  79.     allEnabled,
  80.     enabled, "SleepTime",
  81.      {
  82.         "no Sleep",
  83.             noicon, nokey, nomark, plain;
  84.         "60 Ticks",
  85.             noicon, nokey, check, plain;
  86.     }
  87. };
  88.  
  89.  
  90.  
  91. /* this ALRT and DITL are used as an About screen */
  92.  
  93. resource 'ALRT' (rAboutAlert, purgeable) {
  94.     {40, 20, 160, 330},
  95.     rAboutAlert,
  96.     { /* array: 4 elements */
  97.         /* [1] */
  98.         OK, visible, silent,
  99.         /* [2] */
  100.         OK, visible, silent,
  101.         /* [3] */
  102.         OK, visible, silent,
  103.         /* [4] */
  104.         OK, visible, silent
  105.     }
  106. };
  107.  
  108. resource 'DITL' (rAboutAlert, purgeable) {
  109.     { /* array DITLarray: 5 elements */
  110.         /* [1] */
  111.         {88, 210, 108, 290},
  112.         Button {
  113.             enabled,
  114.             "OK"
  115.         },
  116.         /* [2] */
  117.         {8, 8, 24, 330},
  118.         StaticText {
  119.             disabled,
  120.             "Mandelbrot computation as an A/ROSE task"
  121.         },
  122.         /* [3] */
  123.         {32, 8, 48, 330},
  124.         StaticText {
  125.             disabled,
  126.             "(launch this first, then 'Exercise')"
  127.         },
  128.         /* [4] */
  129.         {56, 8, 72, 136},
  130.         StaticText {
  131.             disabled,
  132.             "Brought to you by:"
  133.         },
  134.         /* [5] */
  135.         {80, 24, 112, 167},
  136.         StaticText {
  137.             disabled,
  138.             "Joseph Maurer (EURO.DTS)"
  139.         }
  140.     }
  141. };
  142.  
  143.  
  144. /* this ALRT and DITL are used as an error screen */
  145.  
  146. resource 'ALRT' (rUserAlert, purgeable) {
  147.     {40, 250, 160, 510},
  148.     rUserAlert,
  149.     { /* array: 4 elements */
  150.         /* [1] */
  151.         OK, visible, silent,
  152.         /* [2] */
  153.         OK, visible, silent,
  154.         /* [3] */
  155.         OK, visible, silent,
  156.         /* [4] */
  157.         OK, visible, silent
  158.     }
  159. };
  160.  
  161.  
  162. resource 'DITL' (rUserAlert, purgeable) {
  163.     { /* array DITLarray: 3 elements */
  164.         /* [1] */
  165.         {80, 150, 100, 230},
  166.         Button {
  167.             enabled,
  168.             "OK"
  169.         },
  170.         /* [2] */
  171.         {10, 60, 60, 230},
  172.         StaticText {
  173.             disabled,
  174.             "^0."
  175.         },
  176.         /* [3] */
  177.         {8, 8, 40, 40},
  178.         Icon {
  179.             disabled,
  180.             2
  181.         }
  182.     }
  183. };
  184.  
  185. resource 'STR ' (rTaskName, purgeable) {
  186.  "MBTask"
  187. };
  188.  
  189. resource 'STR ' (rTaskType, purgeable) {
  190.  "MBServer"
  191. };
  192.  
  193.  
  194. resource 'STR#' (rErrStrings, purgeable) {
  195.     {
  196.     "You must run on 512Ke or later";
  197.     "Application Memory Size is too small";
  198.     "Not enough memory to run MBTaskSample";
  199.     "Cannot create window";
  200.     "Cannot use A/ROSE Prep";
  201.     "Task already registered";
  202.     "<GetMsg> failed";
  203.     "No Server task found";
  204.     "Problem with ICC Manager";
  205.     "Received message with unknown mCode";
  206.     "Received undeliverable message";
  207.     "AROSEGetMem() failed";
  208.     }
  209. };
  210.  
  211. resource 'STR#' (rWndStrings, purgeable) {
  212.     {
  213.     " Lines computed: ";
  214.     }
  215. };
  216.  
  217.  
  218. resource 'WIND' (rWindow, preload, purgeable) {
  219.     {50, 260, 130, 500},
  220.     noGrowDocProc, visible, noGoAway, 0x0, "MBTaskSample"
  221. };
  222.  
  223.  
  224.  
  225. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  226.  
  227. resource 'SIZE' (-1) {
  228.     dontSaveScreen,
  229.     acceptSuspendResumeEvents,
  230.     enableOptionSwitch,
  231.     canBackground,                /* we can background; we don't currently, but our sleep value */
  232.                                 /* guarantees we don't hog the Mac while we are in the background */
  233.     multiFinderAware,            /* this says we do our own activate/deactivate; don't fake us out */
  234.     backgroundAndForeground,    /* this is definitely not a background-only application! */
  235.     dontGetFrontClicks,            /* change this is if you want "do first click" behavior like the Finder */
  236.     ignoreChildDiedEvents,        /* essentially, I'm not a debugger (sub-launching) */
  237.     not32BitCompatible,            /* this app should not be run in 32-bit address space */
  238.     reserved,
  239.     reserved,
  240.     reserved,
  241.     reserved,
  242.     reserved,
  243.     reserved,
  244.     reserved,
  245.     kPrefSize * 1024,
  246.     kMinSize * 1024    
  247. };
  248.